﻿using LNet;
using OestsCommon.Model;
using OestsServer.Net;
using System;

namespace OestsServer.Handlers.OESPHandlers
{
    public class StartProjectOespHandler : HandlerBase<OESPClientChannel>
    {
        public override PacketKey PKey
        {
            get
            {
                return PacketKey.StartProject;
            }
        }

        public override void Execute(OESPClientChannel client, Request packet)
        {
            base.Execute(client, packet);

            string typeStr = packet.DataStr;
            ProjectType type = (ProjectType)Enum.Parse(typeof(ProjectType), typeStr);
            client.ProjectType = type;
            ResponsePacket.DataObject = packet.DataObject;
            //返回成功
            client.Send(ResponsePacket);
        }
    }
}
